package link.jfire.socket.test;

import link.jfire.baseutil.simplelog.ConsoleLogFactory;
import link.jfire.baseutil.simplelog.Logger;
import link.jfire.jnet.common.InternalResult;
import link.jfire.jnet.common.buffer.ByteBuf;
import link.jfire.jnet.common.exception.SocketException;
import link.jfire.jnet.common.handler.DataHandler;

public class Loghandler implements DataHandler
{
    private Logger logger = ConsoleLogFactory.getLogger(ConsoleLogFactory.DEBUG);
    
    @Override
    public Object handle(Object data, InternalResult result) throws SocketException
    {
        ByteBuf<?> byteBuf = (ByteBuf<?>) data;
        logger.debug("当前buffer状态{}", byteBuf.toString());
        // result.setData(data);
        // result.setIndex(1);
        // result.getChannelInfo().turnToWorkthreadHandle(result);
        // return DataHandler.skipToWorkRing;
        return data;
    }
    
}
